[Job Launcher] Refactor error handling#3326
Merged
Conversation
- Replaced instances of ControlledError with specific error classes (ValidationError, NotFoundError, ConflictError, ServerError) in QualificationService, RateService, RoutingProtocolService, SendGridService, StorageService, Web3Service, WebhookService, and their respective test files. - Removed the storage.errors.ts file as its functionality is now integrated into the common error handling. - Updated tests to reflect changes in error handling and ensure proper error types are thrown and caught.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
dnechay
reviewed
May 12, 2025
Collaborator
dnechay
left a comment
There was a problem hiding this comment.
Looks cleaner! Left some questions and suggestions
- in all places that are not directly used by http layer (e.g.
common/utilsorstorage.service) we probably should not use HTTP-related Errors, it's a bit confusing to see things likeConflictErrorwhen you validate web3 signature and not intuitive for developer from the future on how to pick some specific error class from all of these - I noticed that you changed "http-response code" for some cases (e.g. in
job.servicesome places have 409/422 vs 400 before), can it affect something on UI?
dnechay
previously approved these changes
May 13, 2025
Collaborator
|
Please double-check that client-facing (I mean FE app) functionality is not broken in places where status codes changed |
portuu3
approved these changes
May 14, 2025
flopez7
added a commit
that referenced
this pull request
May 21, 2025
* Refactor error handling across services to use custom error classes - Replaced instances of ControlledError with specific error classes (ValidationError, NotFoundError, ConflictError, ServerError) in QualificationService, RateService, RoutingProtocolService, SendGridService, StorageService, Web3Service, WebhookService, and their respective test files. - Removed the storage.errors.ts file as its functionality is now integrated into the common error handling. - Updated tests to reflect changes in error handling and ensure proper error types are thrown and caught. * feat: enhance error handling and validation across services * feat: add logging for missing user object in WhitelistAuthGuard * fix: update error handling for card deletion and signature verification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue tracking
N/A
Context behind the change
Refactor error handling across services to use custom error classes:
How has this been tested?
Release plan
None
Potential risks; What to monitor; Rollback plan
Check that the new errors are not instance of ControlledError